

function echarts (a,b,c,d) {

    var chartDom = document.getElementById("pic1_img");
    var myChart = echarts.init(chartDom);
    var option;
    option = {
      tooltip: {
        trigger: "item",
        formatter: "{a} <br/>{b}: {c} ({d}%)",
      },
      color: ["#4AC493", "#F0AEA9", "#FA904B", "#F23E3E"],
      legend: {
        orient: "horizontal",
        bottom: 0,
        data: ["正常", "偏瘦", "肥胖", "超重"],
      },
      series: [
        {
          name: "访问来源",
          type: "pie",
          radius: ["50%", "70%"],
          avoidLabelOverlap: false,
          label: {
            show: false,
            position: "center",
          },
          emphasis: {
            label: {
              show: true,
              fontSize: "15",
              fontWeight: "bold",
            },
          },
          labelLine: {
            show: false,
          },
          data: [
            { value: a, name: "正常" },
            { value: b, name: "偏瘦" },
            { value: c, name: "肥胖" },
            { value: d, name: "超重" },
            // {value: 1548, name: '搜索引擎'}
          ],
        },
      ],
    };

    option && myChart.setOption(option);
    return 0
}
export { echarts }